﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace STARShell.Core.Interfaces
{
    /// <summary>
    /// Contains information about a registered service that can be usefull to other services.
    /// </summary>
    [ServiceContract(Namespace = "http://www.sfoxdevelopments.com/2009/12")]
    public class RegistrationInfo
    {
        [DataMember(IsRequired = true, Order = 1)]
        public string Address { get; set; }

        [DataMember(IsRequired = true, Order = 2)]
        public string BindingName { get; set; }

        [DataMember(IsRequired = true, Order = 3)]
        public string ContractName { get; set; }

        [DataMember(IsRequired = true, Order = 4)]
        public string ContractNamespace { get; set; }

        public override int GetHashCode()
        {
            return this.Address.GetHashCode() + this.ContractName.GetHashCode() + this.ContractNamespace.GetHashCode();
        }
    }
}
